/**
 * User: Paulo Fournier
 * Date: 12-08-2013
 * Poi data model
 */

Ext.define('Mobile-app.model.Poi', {
    extend: 'Ext.data.Model',

    config: {
        autoLoad: false,
        fields: [
            //poisForUserId
            {name: 'id',                        type: 'int',        filterable: true},
            {name: 'name',                      type: 'string',     filterable: true},
            {name: 'state',                     type: 'string'},
            {name: 'description',               type: 'string',     filterable: true},
            {name: 'idCategory',                type: 'int'},
            {name: 'category',                  type: 'string',     filterable: true},
            {name: 'radius',                    type: 'int'},
            {name: 'longitude',                 type: 'float'},
            {name: 'latitude',                  type: 'float'},
            {name: 'maximumTimeOfPermanence',   type: 'int'},
            {name: 'idImage',                   type: 'int'}

        ],
        proxy: {
            type: 'ajax',

            api: {
                create: 'app/php/public/poi.add.php',
                read: 'app/php/public/poi.request.php',
                update: 'app/php/public/poi.edit.php',
                destroy: 'app/php/public/poi.delete.php'
            },

            reader: {
                type: 'json'
            }
        }
    }

})